#:kivy 1.0
#import FittableToggleButton ui.fittable_widgets.FittableToggleButton
#import FittableButton ui.fittable_widgets.FittableButton

<PlayersOrderWidget>:

    player_list: player_list
    orientation: 'vertical'
    BoxLayout:
        size_hint_y: None
        height: root.height*0.1
        Button:
            color: 1,0,0,1
            text: _('Back')
            on_release: root.go_back()
        Button:
            color: 0,1,0,1
            text: _('Start')
            on_release: root.finish()

    Label:
        text: _('Players order')
        #valign: "top"
        size_hint_y: 0.2

    ScrollView:
        do_scroll_x: False
        GridLayout:
            cols: 1
            #size_hint_x: 1
            size_hint_y: None
            #orientation: 'vertical'
            id: player_list

    Button:
        size_hint_y: 0.3
        #font_size: 0.6 * self.height
        text: _('Shuffle')
        on_release: root.shuffle()

<PlayerLabel>:
    font_size: 24

<PlayerLine>:
    orientation: 'horizontal'
    width: root.width
    size_hint_y: None
    height: root.root.height * 0.1
    FittableButton:

        text: 'End'
        on_release: root.up_down_pressed(root.index, 1000000)
        background_color: root.color
        size_hint_x: None
        width: self.height
    FittableButton:
        text: 'Down'
        on_release: root.up_down_pressed(root.index, 1)
        background_color: root.color
        size_hint_x: None
        width: self.height
    FittableToggleButton:
        text: root.player.name
        background_color: root.color
        on_release: root.swap_butt_pressed(root.index, self)
    FittableButton:

        text: 'Up'
        on_release: root.up_down_pressed(root.index, -1)
        background_color: root.color
        size_hint_x: None
        width: self.height
    FittableButton:
        text: 'Home'
        on_release: root.up_down_pressed(root.index, -1000000)
        background_color: root.color
        size_hint_x: None
        width: self.height



